From: Jasper St. Pierre Date: Fri, 15 Feb 2013 02:22:49 +0000 (-0500) Subject: layout: Remove _addBarrierEvent X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~1013^2^2~4843 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=e3eb4a20a53e19bede716a3006153b6cfe616f75;p=gnome-shell.git layout: Remove _addBarrierEvent Moving it inline to when we get the event means that we can remove the duplicate call to _getDistanceAcrossBarrier. https://bugzilla.gnome.org/show_bug.cgi?id=693854 --- diff --git a/js/ui/layout.js b/js/ui/layout.js index cae7f8187..f6443edbc 100644 --- a/js/ui/layout.js +++ b/js/ui/layout.js @@ -1190,11 +1190,6 @@ const PressureBarrier = new Lang.Class({ this._barrierEvents = this._barrierEvents.slice(firstNewEvent); }, - _addBarrierEvent: function(event) { - this._barrierEvents.push(event); - this._currentPressure += this._getDistanceAcrossBarrier(event); - }, - _onBarrierLeft: function(barrier, event) { this._reset(); }, @@ -1218,7 +1213,8 @@ const PressureBarrier = new Lang.Class({ this._lastTime = event.time; this._trimBarrierEvents(); - this._addBarrierEvent(event); + this._barrierEvents.push(event); + this._currentPressure += distance; if (this._currentPressure >= this._threshold) { this.emit('trigger');